import Vue from "vue";
import App from "./App"

//导入 mock
import "@/mock"

//注册全局组件
import TypeNav from "@/components/TypeNav"
import Pagination from "@/components/Pagination"
Vue.component("TypeNav", TypeNav);
Vue.component("Pagination",Pagination);

//按需导入element 组件
import { Button,Loading,MessageBox ,Message} from 'element-ui';
Vue.use(Button)

//导入 验证插件
import "@/utils/validate"

Vue.prototype.$loading = Loading.service;
Vue.prototype.$msgbox = MessageBox;
Vue.prototype.$alert = MessageBox.alert;
Vue.prototype.$confirm = MessageBox.confirm;
Vue.prototype.$prompt = MessageBox.prompt;
Vue.prototype.$message = Message;

//导入 图片懒加载插件
import VueLazyload from 'vue-lazyload'
//导入懒加载图片
import loading from "@/assets/image/loading.gif";
//使用并配置
Vue.use(VueLazyload,{
    loading
})

// import ElementUI from 'element-ui';
// import 'element-ui/lib/theme-chalk/index.css';
// Vue.use(ElementUI)


import router from "./router"
//导入 vuex
import store from "@/store"

new Vue({
  el: "#app",
  beforeCreate() {
    Vue.prototype.$bus = this;
  },
  router,
  store,
  render: h => h(App)
})